/* jshint esversion: 6 */
const Router = require('koa-router');
const tool = require("../../tools/tool");
const router = new Router();
const {db, Op, QueryTypes} = require("../../models/db");
// 修改密码
router.post('/user/saveAvatar', async ctx => {
    let fileName = ctx.request.body.fileName
    let id = ctx.request.body.id
    db.models['admin'].update({
        avatar: fileName
    }, {
        where: {
            id: id
        }
    })
    return ctx.suc('图片上传成功')
})

module.exports = router;